package lanQiaoBei.基础算法.前缀和;
import java.io.*;
/*
* 一维前缀和——给定一个整数数列n 给定一个询问 l,r 求l到r的和
* 数列长度0<=N<=100000
* */
public class P1 {
   static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   static int N=100010;
   static int n;
   static int[]a=new int[N];
   static int[]s=new int[N];
   public static void main(String[]args)throws Exception{
         scan();
       String[] ss = br.readLine().split(" ");
       int l=Integer.parseInt(ss[0]),r=Integer.parseInt(ss[1]);
       System.out.println(s[r]-s[l-1]);
   }
   public static void scan()throws Exception{
        n=Integer.parseInt(br.readLine());
       String[] ss = br.readLine().split(" ");
       for(int i=1;i<=n;i++){
           a[i]=Integer.parseInt(ss[i-1]);
           s[i]=s[i-1]+a[i];
       }
   }
}
